﻿using System.Linq;

using VSTalk.Engine.ViewModel.Messenger.History;
using VSTalk.Engine.ViewModel.Messenger.ThreadRenderer.BlockBuilder;
using VSTalk.Engine.ViewModel.Messenger.ThreadRenderer.Model;

namespace VSTalk.Engine.ViewModel.Messenger.ThreadRenderer.Command
{
    public class RemoveHistoryLoader : BaseRenderingCommand
    {
        private HistoryCommandMessage _message;

        public RemoveHistoryLoader(ConversationModel conversationModel)
                : base(conversationModel)
        {
        }

        public override void Execute()
        {
            var targetSection = ConversationModel.Sections.FirstOrDefault(section => section.Type == SectionType.HistoryControl);
            ConversationModel.Remove(targetSection);
        }
    }
}